PLUGIN_REASON_PRINTING_SUPPORT: self.__tr("This plugin will enable printing support."),
PLUGIN_REASON_FASTER_PRINTING: self.__tr("This plugin will enhance print speed."),
PLUGIN_REASON_BETTER_PRINTING_PQ: self.__tr("This plugin will enhance print quality."),
PLUGIN_REASON_PRINTING_FEATURES: self.__tr("This plugin will add printing features."),
PLUGIN_REASON_RESERVED_10: None,
PLUGIN_REASON_RESERVED_20: None,
PLUGIN_REASON_SCANNING_SUPPORT: self.__tr("This plugin will enable scanning support."),
PLUGIN_REASON_FASTER_SCANNING: self.__tr("This plugin will enhance scanning speed."),
PLUGIN_REASON_BETTER_SCANNING_IQ: self.__tr("This plugin will enhance scanning image quality."),
PLUGIN_REASON_RESERVED_200: None,
PLUGIN_REASON_RESERVED_400: None,
PLUGIN_REASON_FAXING_SUPPORT: self.__tr("This plugin will enable faxing support."),
PLUGIN_REASON_FAX_FEATURES: self.__tr("This plugin will enhnace faxing features."),
PLUGIN_REASON_RESERVED_20000: None,
PLUGIN_REASON_RESERVED_40000: None,
}
#
# SOURCE PAGE
#
def showSourcePage(self):
reason_text = self.plugin_reason_text()
if reason_text is not None:
if self.install_mode == PLUGIN_REQUIRED:
self.TitleLabel.setText(self.__tr("An additional driver plug-in is required to operate this printer. You may download the plug-in directly from an HP authorized server (recommended), or, if you already have a copy of the file, you can specify a path to the file (advanced). <br><br>%1").arg(reason_text))
self.SkipRadioButton.setEnabled(False)
elif self.install_mode == PLUGIN_OPTIONAL:
self.TitleLabel.setText(self.__tr("An optional driver plug-in is available to enhance the operation of this printer. You may download the plug-in directly from an HP authorized server (recommended), skip this installation (not recommended), or, if you already have a copy of the file, you can specify a path to the file (advanced).<br><br>%1").arg(reason_text))
status, ret = self.core.download_plugin(self.plugin_path, size, checksum, timestamp,
self.plugin_download_callback)
if status in (PLUGIN_INSTALL_ERROR_UNABLE_TO_RECV_KEYS, PLUGIN_INSTALL_ERROR_DIGITAL_SIG_NOT_FOUND):
endWaitCursor()
if QMessageBox.question(self, self.__tr("Digital signature download failed"),
self.__tr("<b>The download of the digital signature file failed.</b><p>Without this file, it is not possible to authenticate and validate the plug-in prior to installation.</p>Do you still want to install the plug-in?"),
if status == PLUGIN_INSTALL_ERROR_PLUGIN_FILE_NOT_FOUND:
desc = self.__tr("<b>ERROR: Plug-in file not found (server returned 404 or similar error).</b><p>Error code: %1</p>").arg(str(ret))
elif status == PLUGIN_INSTALL_ERROR_DIGITAL_SIG_BAD:
desc = self.__tr("<b>ERROR: Plug-in file does not match its digital signature.</b><p>File may have been corrupted or altered.</p><p>Error code: %1</p>").arg(str(ret))
elif status == PLUGIN_INSTALL_ERROR_PLUGIN_FILE_CHECKSUM_ERROR:
desc = self.__tr("<b>ERROR: Plug-in file does not match its checksum. File may have been corrupted or altered.")
elif status == PLUGIN_INSTALL_ERROR_NO_NETWORK:
desc = self.__tr("<b>ERROR: Unable to connect to network to download the plug-in.</b><p>Please check your network connection and try again.</p>")
elif status == PLUGIN_INSTALL_ERROR_DIRECTORY_ERROR:
desc = self.__tr("<b>ERROR: Unable to create the plug-in directory.</b><p>Please check your permissions and try again.</p>")
self.core.delete_plugin()
endWaitCursor()
FailureUI(self, desc)
self.close()
return
if not self.core.run_plugin(GUI_MODE, self.plugin_install_callback):